package p1.ia;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class PanelControl extends JPanel{

  private PanelMapa pd;

  public PanelControl(PanelMapa pd_){
    super();
    pd = pd_;
    setBackground(Color.blue);

    ImageIcon color = new ImageIcon("color_01.png");
    JButton button = new JButton(color);
    //button.setActionCommand("color");
    add(button);
    button.addActionListener(new ActionListener() {
    	public void actionPerformed(ActionEvent e) {
    		//JOptionPane.showMessageDialog(PanelControl.this, e.getActionCommand() + " => Cambiando Color.");
    		//Color c = new Color((int)(Math.random() * 256), (int)(Math.random() * 256), (int)(Math.random() * 256));
    		pd.cambiarColor();
    	}});
  }
}